MarkLogic Server 11.0 Product Documentation
POST /manage/v2/forests/{id|name}

Summary

Initiate a state change on a forest, such as a merge, restart, or attach.

URL Parameters
state The type of state change to initiate. Allowed values: clear, merge, restart, attach, detach, retire, employ. Specify this parameter as form data in the POST body.
database A database name or database id. Include this parameter for operations that logically require a database, such as state=attach. Specify this parameter as form data in the POST body.
Request Headers
Content-Type The MIME type of the data in the request body. The only supported value is application/x-www-form-urlencoded.

Response

Upon successful completion, MarkLogic Server returns status code 200 (ok) or 202 (Accepted).

Required Privileges

This operation requires the manage-admin role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage-admin

Usage Notes

The structure of the data in the POST body is shown below.

Note: The properties described here are for XML payloads. In general they are the same for JSON, with the exception that, in JSON, failover-hosts and forest-replicas are expressed in singular form. For example, in JSON, failover-hosts is instead failover-host and the format is: "failover-host":["hostname"].

database

The name of the database to which this forest is attached.

forest-name

The forest name.

enabled

Forest enabled status.

host

The primary host to which the forest is assigned.

data-directory

The optional public directory for forests.

large-data-directory

The optional directory for large objects in a forest.

fast-data-directory

The optional smaller but faster directory for forests.

fast-data-max-size

Maximum allowable size (in megabytes) of the data to be kept by this forest in the fast-data-directory, or 0 for no limit.

updates-allowed

The kinds of updates that should be allowed for this forest.

availability

Availability of the forest data.

rebalancer-enable

Enable automatic rebalancing after configuration changes.

range

Range configuration for the range assignment policy.

This is a complex structure with the following children:

lower-bound

The lower bound of the range on the forest.

upper-bound

The upper bound of the range on the forest.

partition-number

A partition number for query assignment policy

failover-enable

Enable assignment to a failover host if the primary host is down.

failover-hosts

A list of failover hosts for shared-disk failover.

This is a complex structure with the following children:

failover-host

A failover host.

forest-backups

Backups scheduled for this forest.

This is a complex structure with the following children:

forest-backup

A scheduled forest backup.

This is a complex structure with the following children:

backup-id

The backup ID.

backup-enabled

Whether or not a backup is enabled

backup-directory

The backup directory pathname.

backup-type

What type of backup is this.

backup-period

How often this backup should run (every n months, weeks, days, hours or minutes).

backup-month-day

The day of the month that this backup happens.

backup-days

The days that this backup happens.

This is a complex structure with the following children:

backup-day

A day that this backup occurs.

backup-start-date

The starting date (in MM/DD/YYYY notation) for a one-time backup

backup-start-time

The starting time (in 24:00 notation).

backup-timestamp

The date and time this backup was created.

forest-replicas

A list of replica forests, used for local-disk failover (changes will reboot the primary forest).*

This is a complex structure with the following children:

forest-replica

The unique key of a forest.

This is a complex structure with the following children:

host

The primary host to which the forest is assigned.

replica-name

The name of a replica forest

data-directory

The optional public directory for forests.

large-data-directory

The optional directory for large objects in a forest.

fast-data-directory

The optional smaller but faster directory for forests.

database-replication

Database replication configuration.

This is a complex structure with the following children:

foreign-replicas

Foreign replicas of this database.

This is a complex structure with the following children:

foreign-replica

Foreign replica of this database.

This is a complex structure with the following children:

foreign-cluster-name

A foreign cluster ID.

foreign-database-name

A foreign database ID.

foreign-forest-name

A foreign forest ID.

foreign-master

Foreign replica of this database.

This is a complex structure with the following children:

foreign-cluster-name

A foreign cluster ID.

foreign-database-name

A foreign database ID.

foreign-forest-name

A foreign forest ID.

Example


$ curl --anyauth --user user:password -X POST -i \
    -d "state=attach" -d "database=Documents" \
    -H "Content-type: application/x-www-form-urlencoded" \
    http://localhost:8002/manage/v2/forests/example

==> The forest named example is attached to the Documents database.
    MarkLogic Server responds with headers similar to the following:

HTTP/1.1 200 OK
Content-type: application/xml
Cache-Control: no-cache
Expires: -1
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy